package com.bjdd.jdy.entity;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/5/10.
 */

public class BankCardBean {

    /**
     * carrierCardId : 1
     * carrierId : 2
     * bankcard : 6228480068780734478
     * realName : 林杰
     * bank : {"bankId":1,"bankName":"农业银行","bankIcon":null,"enabled":true}
     * createTime : 1493779931000
     */

    private int carrierCardId;
    private int carrierId;
    private String bankcard;
    private String realName;
    private BankBean bank;
    private long createTime;

    public static BankCardBean objectFromData(String str) {

        return new Gson().fromJson(str, BankCardBean.class);
    }

    public static List<BankCardBean> arrayBankCardBeanFromData(String str) {

        Type listType = new TypeToken<ArrayList<BankCardBean>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getCarrierCardId() {
        return carrierCardId;
    }

    public void setCarrierCardId(int carrierCardId) {
        this.carrierCardId = carrierCardId;
    }

    public int getCarrierId() {
        return carrierId;
    }

    public void setCarrierId(int carrierId) {
        this.carrierId = carrierId;
    }

    public String getBankcard() {
        return bankcard;
    }

    public void setBankcard(String bankcard) {
        this.bankcard = bankcard;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public BankBean getBank() {
        return bank;
    }

    public void setBank(BankBean bank) {
        this.bank = bank;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public static class BankBean {
        /**
         * bankId : 1
         * bankName : 农业银行
         * bankIcon : null
         * enabled : true
         */

        private int bankId;
        private String bankName;
        private Object bankIcon;
        private boolean enabled;

        public static BankBean objectFromData(String str) {

            return new Gson().fromJson(str, BankBean.class);
        }

        public static List<BankBean> arrayBankBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<BankBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public int getBankId() {
            return bankId;
        }

        public void setBankId(int bankId) {
            this.bankId = bankId;
        }

        public String getBankName() {
            return bankName;
        }

        public void setBankName(String bankName) {
            this.bankName = bankName;
        }

        public Object getBankIcon() {
            return bankIcon;
        }

        public void setBankIcon(Object bankIcon) {
            this.bankIcon = bankIcon;
        }

        public boolean isEnabled() {
            return enabled;
        }

        public void setEnabled(boolean enabled) {
            this.enabled = enabled;
        }
    }
}
